package com.kuangstudy.config.userlocal;

import com.kuangstudy.entity.User;

/**
 * Description:
 * Author: yykk Administrator
 * Version: 1.0
 * Create Date Time: 2021/11/22 22:55.
 * Update Date Time:
 *
 * @see
 */
public class UserThreadLocal {

    private static ThreadLocal<User> userThreadLocal = new ThreadLocal<User>();

    public static void put(User user) {
        userThreadLocal.set(user);
    }

    public static User get() {
        return userThreadLocal.get();
    }

    public static void clear() {
        userThreadLocal.remove();
    }

}
